//获取应用实例
const app = getApp()
Page({
  onLoad: function (options) {
    var that = this;
    that.data.res = options.phone;
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/goTopics.action',
      method: 'post',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        phone: that.data.res,
      },
      success: function (res) {
        if (res.data.status == "success") {
          console.log(res.data.data);
          that.setData({
            buttonlist: res.data.data
          })
        } else {
          console.log("其他");
        }
      }, fail: function (res) {
        wx.hideLoading();
        wx.showToast({
          title: '网络错误！',
          icon: 'none',
          duration: 2000
        })
        return;
      }
    });
  },
  goID: function (e) {
    var that = this;
    //bmid=023&userid=csadmin&xh=1&jtid=023
    console.log("bmid:" + e.currentTarget.dataset.bmid);
    console.log("userid:" + e.currentTarget.dataset.userid);
    console.log("xh:" + e.currentTarget.dataset.xh);
    console.log("jtid:" + e.currentTarget.dataset.jtid);
    wx.navigateTo({
      url: '../sh_index/sh_index?bmid=' + e.currentTarget.dataset.bmid + "&userid=" + e.currentTarget.dataset.userid + "&xh=" + e.currentTarget.dataset.xh + "&jtid=" + e.currentTarget.dataset.jtid + "&phone=" + that.data.res,
    })
  }
})
